﻿using AntdUI.Chat;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TCOChart
{
    public partial class ChatListForm : Form
    {
        public ChatListForm()
        {
            InitializeComponent();
            BindEventHandler();
        }
        
        private void BindEventHandler()
        {
            this.Load += ChatListDemo_Load;
        }

        private void ChatListDemo_Load(object sender, EventArgs e)
        {
            //Task.Run(() =>
            //{
            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("阿威十八式 🙌🖖🤘👋", null, "2023-1-2:23:22:52"));
            //    Thread.Sleep(700);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("搭配 Nuget Tom.HttpLib 可以轻松实现GPT流式传输\n\nhttps://gitee.com/EVA-SS/HttpLib") { Me = true });
            //    Thread.Sleep(700);


            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("估计还是因为长得帅把") { Me = true });
            //    Thread.Sleep(700);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("城区这车油耗就是高，没啥说的，suv本来就不省油"));
            //    Thread.Sleep(700);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("咱这车换个轮眉得多少钱啊"));
            //    Thread.Sleep(1000);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("百来块吧") { Me = true });
            //    Thread.Sleep(2000);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("我看一般都前端做的，winform还没见过"));
            //    Thread.Sleep(700);

            //    chatList.AddToBottom(new AntdUI.Chat.TextChatItem("别聊这些\r\n------------------------------"));
            //    Thread.Sleep(1200);
            //});


            msgList1.Items.Add(new AntdUI.Chat.MsgItem("WPF / Flutter UI")
            {
                Select = true,
                
            });
            msgList1.Items.Add(new AntdUI.Chat.MsgItem("宝宝", Properties.Resources.head)
            {
                Text = "今天给你买一束花",
                Time = DateTime.Now.ToString("HH:mm:ss")
            });
        }

        private void button1_Click(object sender, EventArgs e)
        {
            TextChatItem textChatItem = new AntdUI.Chat.TextChatItem("我看一般都前端做的，winform还没见过", null, "20255-1-25 23:22:52");

            chatList.AddToBottom(textChatItem);
        }
    }
}
